
<!DOCTYPE html>
<html>

<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">


    <title>速算头脑 - 清缓存</title>


    <link rel="shortcut icon" href="favicon.ico">
    <link href="https://cdn.bootcss.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet">
    <link href="https://cdn.staticfile.org/font-awesome/4.4.0/css/font-awesome.css?v=4.4.0" rel="stylesheet">
    <!-- Data Tables -->
    <link href="/Public/Admin/css/plugins/dataTables/dataTables.bootstrap.css" rel="stylesheet">
    <link href="/Public/Admin/css/style.min.css?v=4.1.0" rel="stylesheet">

</head>

<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>速算头脑
                        <small>更新缓存(请谨慎操作)</small>
                    </h5>

                </div>
                
                
                
                <div class="ibox-content">
                	<div>

                        <button class="btn btn-danger " onClick="updatecache('allrank')" type="button"><i class="fa fa-remove" ></i>&nbsp;更新世界排行缓存</button>
                        <br>
                        <button class="btn btn-danger " onClick="updatecache('questions')" type="button"><i class="fa fa-remove" ></i>&nbsp;更新题目缓存</button>
                        <br>
                        <button class="btn btn-danger " onClick="updatecache('rank')" type="button"><i class="fa fa-remove" ></i>&nbsp;更新等级缓存</button>
                        <br>
                        <button class="btn btn-danger " onClick="updatecache('rule')" type="button"><i class="fa fa-remove" ></i>&nbsp;更新规则缓存</button>
                        <br>
                        <button class="btn btn-danger " onClick="updatecache('signconfig')"  type="button"><i class="fa fa-remove" ></i>&nbsp;更新登陆设置缓存</button>
                    </div>


                </div>
            </div>
        </div>
    </div>

</div>

<script src="https://cdn.staticfile.org/jquery/2.1.4/jquery.min.js"></script>
<script src="https://cdn.bootcss.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
<script src="/Public/Admin/js/plugins/dataTables/jquery.dataTables.js"></script>
<script src="/Public/Admin/js/plugins/dataTables/dataTables.bootstrap.js"></script>
<script src="/Public/Admin/js/plugins/layer/layer.js?v=1.0"></script>
<script type="text/javascript" src="/Public/Admin/js/contabs.min.js?v=1.0"></script>
<script>

    function updatecache(obj) {

        var url = "{:U('CountLike/game_updatecache')}";
        $.ajax({
            type : 'post',
            url  : url+'?t='+Math.random(),
            data : "category="+obj,
            dataType : 'json',
            beforeSend: function(){
                lock = 1;
                layer.load(0, {shade: false}); //0代表加载的风格，支持0-2
            },
            success : function(res){
                layer.closeAll();
                if(res.state > 0){
                    layer.msg('更新成功', {icon: 1});
                    // var t = window.setTimeout("reload()",2000);

                }else{
                    layer.msg(res.error, {icon: 2});
                }
            },
            complete: function(){
                lock = 0;
            },
            error : function(XMLHttpRequest, textStatus, errorThrown) {
                layer.closeAll();
                layer.msg('网络失败，请刷新页面后重试', {icon: 2});
            }
        })

    }


</script>
</body>

</html>
